package Model;

import java.util.*;
import javax.swing.*;

/**
 * Class reponsible for running the multiple simulations
 * Is the same game class, but with thread properties
 *
 * @author José Filipe M Santos 7277502
 * @author Vesgo coloca teu nome akie porra
 */
public class MultipleGame extends Game implements Runnable {

    /**
     * Constructor (only one), just initializes the parent class
     *
     * @param pDat Game date
     * @param pHome Home team
     * @param pVis Visitor team
     */
    public MultipleGame(Date pDat, Team pHome, Team pVis) {

        super(pDat, pHome, pVis);

    }

    /**
     * Override of the run method, to give to simulation the thread properties
     */
    @Override
    public void run() {
        try{
            this.simulateGame();
            Thread.sleep(100);
        }
        catch(InterruptedException e){
            JOptionPane.showMessageDialog(null, "Error", "Error", JOptionPane.ERROR_MESSAGE);
        }
    }

}

